#SpriteParser Makefile

include ../Engine/Makefile
include ../MakefileShared
LOCAL_INCLUDE_DIRS= $(LIB_INCLUDES) . ../Engine/ ../Engine/Utilities ../Engine/Graphics

LOCAL_LFLAGS=$(LFLAGS) $(LOCAL_INCLUDE_DIRS:%=-I%)

LOCAL_LIBS= $(LIB_LIBS:%=-L%) -Wl,-rpath,. -L$(EXEC_PATH) -lsfml-network -lsfml-system -lsfml-window -lsfml-graphics -ldl -L$(PROJECT_PATH)/glew-1.7.0/lib -lGLEW -lpugixml

LOCAL_OUTPUT_PATH= $(OUTPUT_PATH)/SpriteParser

LOCAL_FLAGS=$(CFLAGS) $(LOCAL_INCLUDE_DIRS:%=-I%) -MMD -MP -MF

SOURCES=main.cpp \
	$(CONTENT_SOURCES:%=../Engine/%) \
	$(GRAPHIC_SOURCES:%=../Engine/%) \
	$(UTILITY_SOURCES:%=../Engine/%)
OBJECTS=$(SOURCES:.cpp=.o)


.PHONY: all spriteparser clean
all: spriteparser

spriteparser: $(OBJECTS)
	$(CC) -o $(EXEC_PATH)/spriteparser $(OBJECTS) $(LOCAL_LIBS)

$(OBJECTS): %.o: %.cpp
	$(RM) $@.d
	$(CC) $(LOCAL_FLAGS) -MMD -MP -MF $@.d  -o $@ $<	

cleanexec:
	@echo ""
	@echo "Cleaning SpriteParser"
	$(RM) $(EXEC_PATH)/spriteparser

clean: cleanexec
	$(RM) $(OBJECTS)
